<!-- <script setup>
import HelloWorld from './components/HelloWorld.vue'
</script>

<template>
  <div>
    <a href="https://vitejs.dev" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="https://vuejs.org/" target="_blank">
      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <HelloWorld msg="王承烨2430150146" />
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style> -->
<template>
  <div class="app-box">
    <h1>根组件</h1>
    <!-- 路由连接 -->
     <router-link to="/home">首页</router-link>
    <router-link to="/about">关于</router-link>
    <router-link to="/my"> 我的</router-link>
    <hr> 
    <!-- 路由视图 -->
    <transition name="fade" mode="out-in">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script setup>
</script>

<style scoped>
.app-box {
  text-align: center;
  font-size: 20px;
}
.app-box a{
  padding: 20px;
  color: rgb(81, 241, 241);
  text-decoration: none;
  font-weight: bold;
}
.app-box a.router-link-active{
  color: rgb(255, 45, 216);
}

/* 添加淡入淡出动画 */
 .fade-enter-active, .fade-leave-active {
  transition: opacity 3s ease;
}
.fade-enter-from, .fade-leave-to {
  opacity: 0;
} 
</style>